package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.data.WxBaseData;
import com.cskaoyan.bean.param.WxBaseParam;
import com.cskaoyan.bean.pojo.MallTopic;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.wxvo.WxTopicDetailVO;
import com.cskaoyan.bean.wxvo.WxTopicListVO;
import com.cskaoyan.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    TopicService topicService;

@RequestMapping("list")
    public BaseRespVo wxTopicList(WxBaseParam wxBaseParam){
        WxBaseData<WxTopicListVO> wxTopicListVOWxBaseData=topicService.queryTopicList(wxBaseParam);
        return BaseRespVo.ok(wxTopicListVOWxBaseData);
}

@RequestMapping("detail")
    public BaseRespVo wxTopicDetail(Integer id){
    WxTopicDetailVO wxTopicDetailVO = topicService.queryTopicDetail(id);
    return BaseRespVo.ok(wxTopicDetailVO);
}

@RequestMapping("related")
    public BaseRespVo wxTopicRelated(){
    List<MallTopic> mallTopic = topicService.queryTopicRelated();
    return BaseRespVo.ok(mallTopic);

}

}
